home *** CD-ROM | disk | FTP | other *** search
/ Clinical Endocrinology / Clinical Endocrinology.iso / mac / 00000000 / 20000000 / Shared.dir / 00911_Script_911 < prev    next >
Text File  |  1995-11-17  |  2KB  |  89 lines

  1. -- This handler freezes the channels containing text, diagrams
  2. -- captions, and buttons by puppeting them. The aim is to keep
  3. -- the background looking the same when the menus are used.
  4. -- These should be unpuppeted when returning.
  5.  
  6. on puppetsOn
  7.   
  8.   repeat with i = 4 to 10
  9.     
  10.     puppetSprite i, true -- text, diags, captions
  11.     
  12.   end repeat
  13.   
  14.   puppetSprite 33, true -- left arrow
  15.   puppetSprite 34, true -- right arrow
  16.   
  17.   if the clickOn = 14 then
  18.     repeat with i = 15 to 17
  19.       set the visibility of sprite i to true -- menu bits
  20.     end repeat
  21.   else
  22.     repeat with i = 15 to 17
  23.       set the visibility of sprite i to false -- menu bits
  24.     end repeat
  25.   end if
  26.   
  27.   repeat with i = 39 to 45
  28.     
  29.     --puppetSprite i, true -- hypertext
  30.     
  31.   end repeat
  32.   
  33. end puppetsOn
  34. ----------------------------------------------------------
  35. -- This handler is the opposite to the one above.
  36.  
  37. on puppetsOff
  38.   global menuSwitch
  39.   
  40.   repeat with i = 4 to 10
  41.     
  42.     puppetSprite i, false -- text, diags, captions
  43.     
  44.   end repeat
  45.   
  46.   puppetSprite 33, false -- left arrow
  47.   puppetSprite 34, false -- right arrow
  48.   
  49.   repeat with i = 39 to 45
  50.     
  51.     puppetSprite i, false -- hypertext
  52.     
  53.   end repeat
  54.   set menuSwitch = "off"
  55.   puppetSprite 15, false
  56.   repeat with i = 15 to 17
  57.     set the visibility of sprite i to false -- menu bits
  58.   end repeat
  59.   
  60. end puppetsOff
  61. ----------------------------------------------------------
  62. -- This handler should be called on the mouseDown.
  63. -- The handler swops the castmember for the next in line
  64. -- until the mouse button is released. If the mouse
  65. -- is over the original sprite it does the attatched
  66. -- script. If the mouse has moved off the sprite
  67. -- the result is no action.
  68.  
  69. on ButtonCheck theScriptToDo
  70.   
  71.   put the clickOn into whichSprite
  72.   put the castNum of sprite whichSprite into whichcast
  73.   set the castNum of sprite whichSprite = whichcast + 1
  74.   updateStage
  75.   
  76.   repeat while the stillDown
  77.     
  78.   end repeat
  79.   
  80.   if the mouseCast <> whichcast + 1 then
  81.     nothing
  82.     
  83.   else
  84.     sound playFile 1, "Click.aif"
  85.     do theScriptToDo
  86.   end if
  87.   
  88. end ButtonCheck
  89. ----------------------------------------------------------